package tr.richfacesext.filter;

import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

/**
 * 
 * @author mert
 *
 */
public class RichFacesExtResponseWrapper extends HttpServletResponseWrapper {
	
	private CharArrayWriter writer;
	
	public RichFacesExtResponseWrapper(HttpServletResponse response) {
		super(response);
		writer = new CharArrayWriter();
	}

	public PrintWriter getWriter() throws IOException {
		return new PrintWriter(writer);
	}
	
	public String toString() {
	      return writer.toString();
	}
}